package org.bhf.json;

/**
 * Copyright (c) 2007, Blue Hole Software. All rights reserved.
 * Code licensed under the Apache 2.0 License:
 * http://www.apache.org/licenses/
 */

import java.io.IOException;
import java.util.Collection;

/**
 * Values cannot be mapped to the target type.
 */
public class ValueFormatException extends IOException
{
    private static final long serialVersionUID = 1L;

    private final Collection<ConversionError> errors;

    /**
     * @param errors Must not be <code>null</code> or empty.
     * @exclude
     */
    public ValueFormatException( final Collection<ConversionError> errors )
    {
        super( "JSONRead cannot convert one or more values" );
        this.errors = errors;
    }

    /**
     * Return the accumluated conversion errors.
     *
     * @return The accumluated conversion errors.
     */
    public Collection<ConversionError> getErrors()
    {
        return errors;
    }
}